package com.dragon.repository.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 库存表
 * </p>
 *
 * @author sy
 * @since 2023-11-13
 */
@Getter
@Setter
@TableName("dragon_stock")
public class Stock implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 仓库id
     */
    private Integer warehouseId;

    /**
     * 产品spu_id
     */
    private Integer productSkuId;

    /**
     * 计量单位id
     */
    private Integer unitId;

    /**
     * 原有数量
     */
    private Double quantity;

    /**
     * 剩下的数量
     */
    //private Double leftoverNum;

    /**
     * 公司id
     */
    private Integer companyId;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    /**
     * 修改时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    /**
     * 仓库名称
     */
    @TableField(exist = false)
    private String warehouseName;

    /**
     * 规格型号
     */
    @TableField(exist = false)
    private String specificationName;

    /**
     * 单位名称
     */
    @TableField(exist = false)
    private String unitName;

    /**
     * 物品名称
     */
    @TableField(exist = false)
    private String productName;

    /**
     * 类别名称
     */
    @TableField(exist = false)
    private String categoryName;

    /**
     * 类别id
     */
    @TableField(exist = false)
    private Integer categoryId;


}
